package ihm;

import java.awt.BorderLayout;
import java.awt.Desktop;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JTextPane;
import javax.swing.UIManager;
import javax.swing.LayoutStyle.ComponentPlacement;
import java.awt.Color;
import java.awt.Font;
import java.io.File;
import java.io.IOException;

public class popupAlerte extends JFrame {

	private JPanel contentPane;
	/**
	 * Create the frame.
	 */
	public popupAlerte(String texte) {
		setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		setBounds(100, 100, 450, 300);
		setTitle("Alerte");
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		
		JTextPane textPane = new JTextPane();
		textPane.setFont(new Font("Arial", Font.PLAIN, 19));
		textPane.setSelectedTextColor(UIManager.getColor("Button.background"));
		textPane.setEditable(false);
		
		JLabel lblAlerte = new JLabel("Alerte");
		lblAlerte.setFont(new Font("Arial", Font.PLAIN, 49));
		lblAlerte.setForeground(new Color(255, 0, 0));
		GroupLayout gl_contentPane = new GroupLayout(contentPane);
		gl_contentPane.setHorizontalGroup(
			gl_contentPane.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_contentPane.createSequentialGroup()
					.addGap(145)
					.addComponent(lblAlerte)
					.addContainerGap(160, Short.MAX_VALUE))
				.addComponent(textPane, GroupLayout.DEFAULT_SIZE, 432, Short.MAX_VALUE)
		);
		gl_contentPane.setVerticalGroup(
			gl_contentPane.createParallelGroup(Alignment.TRAILING)
				.addGroup(Alignment.LEADING, gl_contentPane.createSequentialGroup()
					.addGap(20)
					.addComponent(lblAlerte)
					.addPreferredGap(ComponentPlacement.UNRELATED)
					.addComponent(textPane, GroupLayout.DEFAULT_SIZE, 167, Short.MAX_VALUE))
		);
		textPane.setText(texte);
		contentPane.setLayout(gl_contentPane);
	}
	
	
	
}
